<!DOCTYPE html>
<!--conf
<sample>
              <product version="4.0b1" edition="std"/>
                     <modifications>
                            <modified date="130911"/>
                     </modifications>
               </sample>
-->
<html>
<head>
	<title>onMoveFinish event</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<style>
		div.info {
			margin: 0px 10px;
			font-size: 14px;
			font-family: Tahoma;
			color: #404040;
			height: 80px;
		}
		div.info_title {
			font-weight: bold;
			font-size: 15px;
			margin-bottom: 7px;
			color: #3b5e7c;
		}
		div#winVP {
			position: relative;
			height: 350px;
			border: #a4bed4 1px solid;
			border-radius: 2px;
			margin: 10px;
		}
		div#logsHere {
			position: relative;
			height: 100px;
			border: #dddddd 1px solid;
			padding: 4px;
			margin: 30px 10px 10px 10px;
			font-size: 12px;
			font-family: Tahoma;
			overflow: auto;
		}
	</style>
	<script>
		var dhxWins, w1, w2, w3;
		function doOnLoad() {
			dhxWins = new dhtmlXWindows();
			dhxWins.attachViewportTo("winVP");
			
			w1 = dhxWins.createWindow("w1", 20, 30, 320, 200);
			w1.setText("dhtmlxWindow #1");
			w1.button("close").disable();
			
			w2 = dhxWins.createWindow("w2", 50, 70, 320, 200);
			w2.setText("dhtmlxWindow #2");
			w2.button("close").disable();
			
			w3 = dhxWins.createWindow("w3", 80, 110, 320, 200);
			w3.setText("dhtmlxWindow #3");
			w3.button("close").disable();
			
			// personal event
			w1.attachEvent("onMoveFinish", function(win){
				writeLog("personal event onMoveFinish called for "+win.getText());
			});
			
			// global events
			dhxWins.attachEvent("onMoveFinish", function(win){
				writeLog("global event onMoveFinish was called for "+win.getText());
			});
			
		}
		function writeLog(text) {
			document.getElementById("logsHere").innerHTML += "<br>"+text;
			document.getElementById("logsHere").scrollTop = document.getElementById("logsHere").scrollHeight;
		}
		function doOnUnload() {
			if (dhxWins != null && dhxWins.unload != null) {
				dhxWins.unload();
				dhxWins = w1 = w2 = w3 = null;
			}
		}
	</script>
</head>
<body onload="doOnLoad();" onunload="doOnUnload();">
	<div class="info">
		<div class="info_title">onMoveFinish</div>
		window #1 have personal event, #2 and #3 global events attached<br>
		file ext/dhtmlxwindows_dnd.js should be included for dnd/move
	</div>
	<div id="winVP"></div>
	<div id="logsHere">logs</div>
</body>